Compiler options

In SNiFF+, compiler options and Make information are stored in a set of pre-configured Makefiles in your

<sniff_installation_dir>/make_support directory. These include a:

- Language Makefile:

general.java.mk

| Note
| The general.java.mk file works for almost all compilers. If for some reason you want your compiler to do the dependency checking itself, or you cannot switch off dependency checking in your compiler, then use the additional Makefile called general.javapure.mk .

- Platform Makefile e.g.
i386-unknown-win32.mk or
sparc-sun-solaris4.1.mk
- A Project Makefile (named
Makefile ) is generated by SNiFF+ for each project and stored in the corresponding project directories.
Settings at platform level
To set compiler options at the platform level, you need to edit your Platform Makefile in the <sniff_installation_dir>/make_support directory. To get to the information for Java, look for the following text block in your <platform>.mk file

#
# java compiler
#
JAVAC = $(SNIFF_DIR)/BIN/sniffjavac.exe
JAVA_DEPEND_FLAG =
JFLAGS = -g
JAVA_INTERPRETER = java
JAVA_APPLET_VIEWER = appletviewer
The -depend option
Note that you can only use this option with the Java compiler and not with the sniffjmake wrapper since dependency checking is handled by the wrapper itself.
The following line in your <platform>.mk file
JAVA_DEPEND_FLAG =
is where you can set the -depend option.
The -depend option causes automatic recompilation of all class files on which source files recursively depend. Without this option (default), only out-of-date files that are directly depended on will be recompiled. Missing or out-of-date files only depended on by already up-to-date class files are not (re-)compiled.
To set the option, change the above line to read:
JAVA_DEPEND_FLAG = -depend
Note that, if you set this option, the JDK Java compiler will report errors for already compiled anonymous classes - and create new (additional) ones. Therefore, if you use this option, be sure to delete the already compiled anonymous classes before each new build. Also, be aware that your builds will be slower.
Debug information: the -g option
The -g option enables generation of debugging tables (default) and is set in the line:
JFLAGS = -g
If you want a release version of your software (no debug information), change the line to:
JFLAGS =
Other options
You can also set other options (see your compiler documentation) in the line
JFLAGS =
by leaving a space between each option you enter after the "=" sign.
Using a compiler other than the JDK javac compiler
The following line in your <platform>.mk file
JAVAC = javac
specifies the JDK javac compiler. Change this line to conform to:
JAVAC = <path_to_your_compiler_dir>/yourCompilerName
Setting options at project level
Note that compiler options set at project level are valid only for the project and override those set at the platform level. Overriding platform-specific settings is not recommended, as Project Makefiles should remain platform-independent.
To add options for a particular project, look in the project's Makefile for the line starting with
#OTHER_JFLAGS =
Enter the required options (separated by a space) after the "=" sign and remove the "#" at the beginning of the line.